

import java.util.Scanner;

public class Text {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] arr = new int[200];
    }
    public static void main3(String[] args) {
        //先设置一个随机数
        int random = (int) (Math.random() * 100) + 1;
        //输入一个整数
        Scanner scanner = new Scanner(System.in);
        int count = 5;
        while (count >= 1) {
            System.out.println("请输入一个整数1~100: ");
            int num = scanner.nextInt();
            if (random > num) {
                count--;
                System.out.println("猜小了,请继续猜!" + "你还有" + count + "机会");
            } else if (random < num) {
                count--;
                System.out.println("猜大了,请继续猜!" + "你还有" + count + "机会");
            } else {
                System.out.println("恭喜你!你猜对了!该数字为:" + random);
                break;
            }
        }
        System.out.println("您的次数用完了,gameOver!!!");
    }
}
